using System.Collections.Generic;	
public class GameConfigDatas
{
	public List<GameConfigData> info;
}

[System.Serializable]
public class GameConfigData
{
	public long Id;

	///目标食物种类(青草、包菜、桃子、南瓜) 
	public int[] type;

	///目标食物数量 
	public int[] num;

	///活力值减少频率（简单）/s 
	public int easy;

	///活力值减少频率（困难）/s 
	public int diff;

	///限制时长(分钟) 
	public int limitTime;

	///普通难度-狼（数量） 
	public int wolf;

	///运输箱（空+包+桃） 
	public int[] transportCase;

	///宝箱(吸尘器+羊角) 
	public int[] treasureBox;
	
	private Dictionary<MapItemType,int> needItems;

	public Dictionary<MapItemType, int> GetNeedItems()
	{
		if (needItems != null) return needItems;
		needItems = new Dictionary<MapItemType, int>();
		for (int i = 0; i < type.Length; i++)
		{
			MapItemType itemType = (MapItemType.Max - type[i]);
			needItems.Add(itemType, num[i]);
		}

		return needItems;
	}

	public int GetNeedTransportCaseNum()
	{
		int need = 0;
		for (int i = 0; i < transportCase.Length; i++)
		{
			need += transportCase[i];
		}

		return need;
	}

	public int[] GetTransportCase()
	{
		return transportCase;
	}

	public int GetNeedTreasureBoxNum()
	{
		int need = 0;
		for (int i = 0; i < treasureBox.Length; i++)
		{
			need += treasureBox[i];
		}

		return need;
	}
	
	public int[] GetTreasureBox()
	{
		return treasureBox;
	}
}
